package com.isoft.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft.entity.Role;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RoleMapper extends BaseMapper<Role> {
    @Results({
            @Result(property = "id",column = "id"),
            @Result(property = "rolePermissions", column = "id",
                    many = @Many(select = "com.isoft.mapper.RolePermissionMapper.selectPermissonIdByRoleId"))
                            })
    @Select("select * from role where id=#{id}")
    Role selectRoleById(Integer id);
}